﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Rubyer;
using StockUI.Model;
using System.Collections.ObjectModel;

namespace StockUI.ViewModels
{
    public partial class ZtgcViewModel : ObservableObject
    {
        [ObservableProperty]
        private ObservableCollection<ZtItemDataModel> ztgcItems;

        public ZtgcViewModel()
        {
          ObservableCollection<ZtItemDataModel> list = new ObservableCollection<ZtItemDataModel>();
            for (int i = 0; i < 20; i++)
            {
                list.Add(new ZtItemDataModel
                {
                    Code = $"00000{i}",
                    Url = "https://quote.eastmoney.com/concept/sz000006.html?from=ztzt",
                    Name = "深振业Ａ",
                    Close = "8.82",
                    Change = "",
                    ChangePercent = "9.98%",
                    Volume = "",
                    Amount = "7338万",
                    TotalMarket = "119.1亿",
                    FAMC = "119.1亿",
                    TurnoverRate = "0.62%",
                    ClosedBoard = "1.07亿",
                    FirstSealingTime= "09:25:00",
                    LastSealingTime= "09:25:00",
                    ExplosionsNum = "0次",
                    LimitUp = "5/6",
                    ConnectedBoards= "2连板",
                    Sector = "房地产开"
                });
            }
            ZtgcItems = list;
        }
        [RelayCommand]
        private async Task Delete(ZtItemDataModel info)
        {
            var result = await MessageBoxR.Confirm("是否删除信息？");
            Message.Show(result);
        }
    }
}
